package com.ques.config;

import com.ques.utils.RedisUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * @author zq  2020-02-02
 */
@Configuration
public class RedisConfig {

    @Value("${spring.redis.host:disabled}")
    private String host ;
    @Value("${spring.redis.port:0}")
    private int port  ;
    @Value("${spring.redis.database:0}")
    private int database;

    @Bean
    public RedisUtil getRedisUtil(){
        RedisUtil redisUtil = new RedisUtil() ;
        redisUtil.initPool(host,port,database);
        System.out.println("redis:");
        System.out.println(host);
        System.out.println(port);
        System.out.println(database);
        return redisUtil ;
    }


}
